const domainName = getApp().globalData.domainName
const parameter = getApp().globalData.parameter

// pages/sysConfig/Test_stages_edit/Test_stages_edit.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  input_stage_name(e){
    this.data.stage_name = e.detail.value
  },

  submit(){
    wx.showModal({
      content: '确定提交吗？',
      title: '提示',
      success: res => {
        if(res.confirm){
          wx.request({
            url: domainName + 'Test_stages_edit_submit',
            data: {
              stage_id:this.data.stage_id, 
              stage_name:this.data.stage_name, 
            },...parameter,
            success: res => {
              if(res.data.update_res){
                wx.showToast({
                  title: '修改完成',
                })
              }
            },
          })
        }
      },
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log('options',options)
    let stage_id = options.stage_id
    let stage_name = options.stage_name
    this.setData({
      stage_id:stage_id,
      stage_name:stage_name,
    })
  },

})